<!DOCTYPE html>
<html lang="en">    
    <head>
        <meta charset="UTF-8">
        <title>iframe</title>
    </head>    
    <body>
        <iframe id="mainFrame" src="" frameborder="0"></iframe>
    </body>

	<script>
		var iframeElem = document.getElementById('mainFrame');
		console.log(iframeElem.contentWindow.location);
		iframeElem.contentWindow.location.href = 'main.html';
	</script>
</html>